//sessionStorage

class Sess {
  set(key, value) {
    if (typeof value === "object") {
      value = JSON.stringify(value);
    }
    sessionStorage.setItem(key, value);
  }

  get(key) {
    let value = sessionStorage.getItem(key) || "";
    if (value.includes("[") || value.includes("{")) {
      value = JSON.parse(value);
    }
    return value;
  }
  del(key) {
    // let value = sessionStorage.getItem(key) || ''
    // if (value.includes('[')||value.includes('{')) {
    //     value = JSON.parse(value)
    // }
    // return value
    sessionStorage.removeItem(key);
  }
}

export default new Sess();
